
#ifndef __TAL_NV_FLASH_H__
#define __TAL_NV_FLASH_H__


#ifdef __cplusplus
    extern "C" {
#endif

#include "tuya_cloud_types.h"

typedef enum {
    TAL_KV_SUCC = 0,
    TAL_KV_KEY_NO_FOUND,
    TAL_KV_LEN_ERR,
    TAL_KV_CRC_ERROR,
    TAL_KV_NORMAL_ERR,
} TAL_KV_STATUS_T;

TAL_KV_STATUS_T tal_kv_reset(VOID_T);
TAL_KV_STATUS_T tal_kv_flash_delete(UINT8_T key_id);
TAL_KV_STATUS_T tal_kv_flash_read(UINT8_T key_id, UINT16_T len, UINT8_T *buf);
TAL_KV_STATUS_T tal_kv_flash_write(UINT8_T key_id, UINT16_T len, UINT8_T *buf);


#ifdef __cplusplus
}
#endif

#endif

